SRC = ..
UDNSDIR = $(SRC)/muduo-udns/udns-0.2
MUDUO_PATH = ~/build/release-install-cpp11
CXX = g++
CXXFLAGS = -std=c++14 -Wconversion -Wall -I $(MUDUO_PATH)/include
CXXDLAGS = -L $(MUDUO_PATH)/lib/ -L $(UDNSDIR)  -lmuduo_net -lmuduo_base -ludns -lpthread -lrt 

OBJECTS    = ../tunnel.o ./socks4a.o ../muduo-udns/Resolver.o
EXECUTABLE = socks4a
INCLUDE    = -I $(MUDUO_PATH)/include -I ../ 

main: main.cc
	$(CXX) $(INCLUDE) $(CXXFLAGS) ./socks4a.cc -c $(CXXDLAGS) -o ./socks4a.o
	$(CXX) $(INCLUDE) $(CXXFLAGS) main.cc $(OBJECTS) $(CXXDLAGS) -o $(EXECUTABLE)

.PHONY : clean 
clean :
	rm  $(EXECUTABLE) ./socks4a.o